<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('u_tg',$QXARR))exit(noauth());
require_once ZEAI.'cache/udata.php';
$nav='index';
require_once ZEAI.'m/div_left_so.php';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ZEAI_list{padding:100px 0 80px;width:92%;margin:0 auto}
.ZEAI_list dl{width:100%;margin:0 auto 20px auto;border-radius:8px;background-color:#fff;box-shadow:0 0 28px rgb(0 0 0 / 8%);position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;position:relative}
.ZEAI_list dl .tbody{padding:0 10px;margin:0 auto 10px auto;line-height:40px;color:#999;border-bottom:#f5f5f5 1px solid;text-align:left}
.ZEAI_list dl .tbody{font-size:12px;text-align:left;color:#999}
.ZEAI_list dl .tbody b,.ZEAI_list dl .tbody span{display:inline-block;color:#333;font-weight:normal;vertical-align:middle}
.ZEAI_list dl .tbody span{color:#999}
.ZEAI_list dl .tbody .tginfo{float:right;font-size:12px;line-height:44px}
.ZEAI_list dl .tbody .tginfo i{transform:scaleX(-1);margin-right:8px;margin-top:-3px;font-size:16px;vertical-align:middle}
.ZEAI_list dl .tbody .flag-1{color:#00f}
.ZEAI_list dl .tbody .flag0{color:#f00}
.ZEAI_list dl .tbody .flag1{color:#45c01a}
.ZEAI_list dl .tbody .flag2{color:#999}
.ZEAI_list dl dt,.ZEAI_list dl dd{float:left;display:block;padding-top:10px}
.ZEAI_list dl dt{width:50px;padding-left:10px;font-size:14px;text-align:left;line-height:150%}
.ZEAI_list dl dt img.photo_s{width:40px;height:40px;object-fit:cover;-webkit-object-fit:cover;border-radius:50%}
.ZEAI_list dl dd{width:-webkit-calc(100% - 90px);text-align:left}
.ZEAI_list dl dd h5{font-size:12px}
.ZEAI_list dl dd h5 b{color:#ccc;font-weight:normal}
.ZEAI_list dl dd h6{margin-top:7px}
.ZEAI_list dl dd h6 b{color:#ccc;font-weight:normal}
.ZEAI_list dl dd h6 font{color:#090}
.ZEAI_list dl .flag_wait{position:absolute;;right:10px;bottom:5px}
.ZEAI_list dl .rz_str{position:absolute;left:55px;top:114px}
.ZEAI_list dl .rz_str .RZBOX i{background-color:#ddd;vertical-align:middle;font-size:14px;border-radius:3px;margin:0 2px;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.ZEAI_list dl .btn{position:absolute;right:12px}
.ZEAI_list dl .qq797311{top:62px;background-color:<?php echo $_ADM['color'];?>}
.ZEAI_list dl .datali{margin-top:5px;padding:0 10px 10px;text-align:left;font-size:12px;position:relative}
.ZEAI_list dl .datali h6{width:85%}
.ZEAI_list dl .datali span{display:inline-block;padding:5px 10px;margin:5px 4px;border-radius:3px;box-shadow:0 0 4px rgb(0 0 0 / 9%);max-width:94%;word-wrap:break-word;}
.ZEAI_list dl .datali .chkbox{position:absolute;right:10px;bottom:10px}
</style>
</head>
<body>
<?php
$SQL = "tguid>0 AND tgflag=0";
$Skey = trimhtml($Skey);
//搜索
$Skey = trimhtml($Skey);
if (!empty($Skey)){
	if(ifmob($Skey)){
		$SQL .= " AND mob=".$Skey;	
	}elseif(ifint($Skey)){
		$SQL .= " AND (id=".$Skey." OR tguid=".$Skey.")";	
	}else{
		$SQL .= " AND (  ( uname LIKE '%".$Skey."%' )  ) ";
	}
}
$t1=$db->COUNT(__TBL_USER__,"tgflag=0 AND tguid>0 ");
$rt = $db->query("SELECT id,photo_s,areatitle,regtime,tgflag,uname,flag,tguid,regip,mob,nickname,subscribe FROM ".__TBL_TG_USER__." WHERE ".$SQL." ORDER BY id DESC LIMIT ".$_ADM['admLimit']);
$total = $db->num_rows($rt);
//
$mini_title='推广提成确认';$mini_class='top_mini4 ';
$mini_L = '<em onClick="zeai.openurl(\'m_adm.php\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<div class="tabmenu tabmenu2 tabmenufix">
	<a href="m_u_tg.php">单身用户(<?php echo $t1;?>)</a>
	<a href="m_tg_tg.php" class="ed">推广员(<?php echo $total;?>)</a>
</div>
<form id="www_zeai_cn_FORM" class="ZEAI_list" method="get" action="<?php echo SELF; ?>">
	<?php
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=8;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt,'name');if(!$rows) break;
			$id  = $rows['id'];
			$uid  = $id ;
			$photo_s   = $rows['photo_s'];
			$flag      = $rows['flag'];
			$areatitle = $rows['areatitle'];
			$regtime   = $rows['regtime'];
			$tgflag    = $rows['tgflag'];
			$uname     = dataIO($rows['uname'],'out');
			$nickname  = trimhtml(dataIO($rows['nickname'],'out'));
			$mob  = dataIO($rows['mob'],'out');
			$flag  = $rows['flag'];
			$tguid = $rows['tguid'];
			$regip = $rows['regip'];
			$regtime  = YmdHis($rows['regtime']);
			$subscribe = $rows['subscribe'];
			$uname=(empty($uname))?$mob:$uname;
			$uname = str_replace($Skey,"<b class='Cf00'>".$Skey."</b>",$uname);
			$photo_s_url = (!empty($photo_s))?UP.$photo_s:RES.'noP.gif';
			if($tgflag == 1){
				$tgflag_str = '成功';
			}else{
				$tgflag_str = '<img src="images/flag_wait.png" width="45" height="45">';
			}
			$tgbtn_str  = '<button uid="'.$uid.'" tguid="'.$tguid.'" type="button" class="btn size2 qq797311" style="margin-top:5px">通过</button>';
			$row2 = $db->ROW(__TBL_TG_USER__,"uname,mob","id=".$tguid);
			if ($row2){
				$tguname2 = $row2[0];$tgmob2= dataIO($row2[1],'out');
				$tguname2 = (empty($tguname2))?$tgmob2:$tguname2;
				$tginfo  = '<i class="ico">&#xe62d;</i>推广员：'.$tguid;
				//$tginfo .= '（'.$tguname2.'）';
			}else{
				$db->query("UPDATE ".__TBL_TG_USER__." SET tguid=0,tgflag=0 WHERE id=".$id);
				$tginfo = '无';
			}
			$mob_str = (!ifmob($mob))?'':'<span>手机：'.$mob.'</span>';?>
            <dl id="tr<?php echo $id;?>">
            	<div class="tbody">
                	<b><?php echo $uid;?></b><span>（<?php echo $uname.'&nbsp;&nbsp;|&nbsp;&nbsp;'.$nickname;?>）</span>
                    <div class="tginfo"><?php echo $tginfo;?></div>
				</div>
                <dt><a href="javascript:ZeaiM.piczoom('<?php echo smb($photo_s_url,'b');?>');"><img class="photo_s" src="<?php echo $photo_s_url;?>"></a></dt>
                <dd>
                	<h5>
                    状态：<?php
					if($flag==1){echo '<font class="C090">正常</font>';}elseif($flag==0){echo '未审';}elseif($flag==2){echo '<font class="Cf00">未激活</font>';}
                    if($subscribe==0){
                        echo '<span class="C999"></span>';
                    }elseif($subscribe==1){
                        echo '　<b>|</b>　公众号：<i class="ico S14 C090">&#xe6b1;</i>';
                    }else{
                        echo '　<b>|</b>　公众号：<span class="C00f">取消</span>';
                    }
					?>
					</h5>
					<h6>注册：<?php echo $regtime;?></h6>
                </dd>
                <div class="rz_str"><?php echo $rz_str;?></div>
                <div class="flag_wait"><?php echo $tgflag_str;?></div>
                <?php echo $tgbtn_str;?>
                <div class="clear"></div>
				<div class="datali">
                	<h6><?php echo $mob_str;?></h6>
                </div>
            </dl>
			<?php
		}
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="<?php echo SELF;?>" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="推广员ID/合伙人ID-手机" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->
<?php if ($total > $pagesize ) {?>
    <?php echo $page_cls;?>
    <div class="listbottombox" style="text-align:center">
        <?php if ($total > $pagesize)echo '<div class="pagebox" style="float:initial">'.$pagelist.'</div>'; ?>
    </div>
<?php }?>
<?php if ($total > 0 ) {?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<script>
document.body.onscroll = backtop_alone;
zeai.listEach('.qq797311',function(obj){obj.onclick = function(){
	zeai.confirm('确认要通过么？<br><br>验证成功后将把奖励金额入账到推广员【余额账户】',function(){
		zeai.msg('正在验证...',{time:20});
		var uid=obj.getAttribute("uid");
		var tguid=obj.getAttribute("tguid");
		zeai.ajax('tg_tg'+zeai.ajxext+'submitok=ajax_tg_flag1&uid='+uid+'&tguid='+tguid,function(e){var rs=zeai.jsoneval(e);
			if (rs.flag == 1){zeai.msg(0);zeai.msg(rs.msg);setTimeout(function(){zeai.msg(rs.msg);location.reload(true);},1000);}else{zeai.msg(0);zeai.alert(rs.msg);}
		});
	});
}});
</script>
<?php }?>
</body></html><?php ob_end_flush();?>